﻿using SimpleFactory.AbstractProduct;
using SimpleFactory.Product;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SimpleFactory
{
    public class Factory
    {
        public static Operator CreateOperator(string? symbol)
        {
            switch (symbol)
            {
                case "+":
                    return new Addition();
                case "-":
                    return new Subtraction();
                case "*":
                    return new Multipliction();
                case "/":
                    return new Division();
                case "%":
                    return new Surplus();
                default:
                    throw new Exception("请输入正确的运算符");
            }

        }
    }
}
